<?php
/*
 * Created on Feb 7, 2010
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
 	$title = 'Thiết lập';
 	include('../includes/session.php');
	if($session->logged_in){
		if($session->userlevel == 1){
			header("Location: ../index.php");
		}
	}else{
		header("Location: login.php");
	}
	include('../includes/encrypturl.php');
	include('../models/info_model.php');
	$session->setHeader(7);	
 	include('../includes/header.inc');
	echo '<div id="wrapper">';
	echo '<div id="content">';
	echo '<div id="box">';
	
	if(isset($_SESSION['edit'])){
	   if($_SESSION['edit']){
	   		echo prnMsg(_('Thông tin website đã cập nhật thành công.'),'success');
	   }	  
	   else{
	      echo prnMsg(_('Thông tin website chưa cập nhật.'),'success');
	   }
	   unset($_SESSION['edit']);
	}
	
	$mySite = $infoModel->getCompanyInfo();
	
	echo "<form id='form' method='post' action='../controllers/info_controller.php" . "?" . SID . "'>";
	echo '<h3 id="adduser">Cập nhật thông tin Website</h3><br/>';
	echo '<fieldset id="personal">';
    echo '<legend>THÔNG TIN CHUNG</legend>';
	
	echo '<label for="company">Tên công ty: </label>
		<input name="company" id="company" type="text" tabindex="1" size="70" value="'. $mySite["companyName"] .'"/><br />';
	echo '<label for="copyright">Bản quyền: </label>
		<input name="copyright" id="copyright" type="text" tabindex="1" size="70" value="'.$mySite["copyright"].'"/><br />';
	echo '<label for="address">Địa chỉ: </label>
		<input name="address" id="address" type="text" tabindex="1" size="70" value="'.$mySite["address"].'"/><br />';
	echo '<label for="phone">Số điện thoại: </label>
		<input name="phone" id="phone" type="text" tabindex="1" size="70" value="'.$mySite["phone"].'"/><br />';
	echo '<label for="fax">Fax: </label>
		<input name="fax" id="fax" type="text" tabindex="1" size="70" value="'.$mySite["fax"].'"/><br />';
	echo '<label for="website">Tên website: </label>
		<input name="website" id="website" type="text" tabindex="1" size="70" value="'.$mySite["website"].'"/><br />';
	echo '<label for="email">Email: </label>
		<input name="email" id="email" type="text" tabindex="1" size="70" value="'.$mySite["email"].'"/><br />';
	echo '<input type="hidden" name="infowebsite" value="1" />';
	echo '</fieldset>';
	echo '<div align="center">
     		<input name="submit" type="submit" value="Đồng ý" /> 
            <input name="reset" type="reset"  value="Thiết lập lại"/>
          </div></form>';
	
	echo '</div>';
	echo '</div>';
	include('../includes/footer.inc');
?>
